---
title: "SD-04 | UC-04: Detect Obstacle (Left & Right)"
---
sequenceDiagram
    actor OS as Obstacle Sensor (HW)
    participant LS as left:ObstacleSensor
    participant RS as right:ObstacleSensor
    participant CTR as :Controller

    OS->>LS: detect()
    activate LS
    LS->>CTR: reportObstacle(LEFT)
    activate CTR
    CTR->>CTR: recordObstacleDetection(LEFT)
    CTR-->>LS: ack()
    deactivate CTR
    deactivate LS

    OS->>RS: detect()
    activate RS
    RS->>CTR: reportObstacle(RIGHT)
    activate CTR
    CTR->>CTR: recordObstacleDetection(RIGHT)
    CTR-->>RS: ack()
    deactivate CTR
    deactivate RS
